<section id="house-sharing" class="ml-24 mr-24">
  <hl-page-header title="房源分享">
      <hl-button type="outline" @on-click="routerGo" v-if="quanxian.indexOf('c170') > -1">新建分享</hl-button>
  </hl-page-header>
  <!-- 搜索部分 -->
  <div class="clearfix search-container-house border-b ptb-10">
    <div class="pull-left">
      <p class="color-cfcfcf">信息检索</p>
      <div class="search-text">
        <span class="icon-Gm-search"></span>
        <input type="text" class="" v-model="keyword" placeholder="分享标题" />
      </div>
    </div>

    <div class="pull-left ml-10">
      <p class="color-cfcfcf">创建时间</p>
      <div class="clearfix">
        <div class="calendar-text pull-left">
          <web-calendar v-model="beginTime" tips="起始时间"></web-calendar>
        </div>
        <div class="pull-left line-height-34 color-999 plr-12">-</div>
        <div class="calendar-text pull-left">
          <web-calendar v-model="endTime" tips="截止时间"></web-calendar>
        </div>
      </div>
    </div>

    <div class="pull-left ml-10" v-if="flag">
      <p class="color-cfcfcf">项目</p>
			<hl-select :data="projectList" v-model="projectId" width="140" @on-change="getGroupPrimaryData"></hl-select>
    </div>
    <div class="pull-left ml-10" v-if="flag">
      <p class="color-cfcfcf">组合</p>
      <hl-cascader :selected="selectedGroupData" :width="220" :primary-data="groupOneData" :secondary-data="groupTwoData" :tertiary-data="groupThreeData" @on-primary-change="selectOneGroup" @on-secondary-change="selectTwoGroup" @on-tertiary-change="selectThreeGroup"></hl-cascader>
    </div>

    <div class="pull-left mt-10" v-if="flag">
      <p class="color-cfcfcf">楼宇</p>
			<hl-select :data="buildingList" v-model="buildingId" width="140" @on-change="getbuildingId"></hl-select>
    </div>

    <div class="pull-left mt-10 ml-10" v-if="flag">
      <p class="color-cfcfcf">楼层</p>
			<hl-select :data="floorList" v-model="floorId" width="140" @on-change="getfloorId"></hl-select>
    </div>
    <div class="pull-left mt-10 ml-10" v-if="flag">
      <p class="color-cfcfcf">单元</p>
			<hl-select :data="unitList" v-model="unitId" width="140" @on-change="getunitId"></hl-select>
    </div>
    <div class="pull-left mt-10 ml-10" v-if="flag">
      <p class="color-cfcfcf">创建人</p>
			<hl-select :data="createRen" v-model="creator" width="140" @on-change="createPeople"></hl-select>
    </div>

    <div class="pull-left ml-10" :class="{'mt-10': flag}">
      <p style="color:#fff;">/</p>
      <hl-button @on-click="search" size="mini">查询</hl-button>
      <hl-button @on-click="resetData" size="mini">重置</hl-button>
    </div>

    <div class="global_open_sign" @click="showHideTerm">
      <span v-if="!flag">更多筛选项</span>
      <span v-if="flag">收起筛选项</span>
    </div>
  </div>

  <!-- 主体列表 -->
  <div class="house-sharing-list clearfix">
    <div class="house-left">
      <div class="house-scroll">
        <div class="house-title">
          <div class="dy-flex">
            <div class="dy-fx-1">序</div>
            <div class="dy-fx-3">分享标题</div>
            <div class="dy-fx-3">关联项目</div>
            <div class="dy-fx-3">创建时间</div>
            <div class="dy-fx-3 cursor" @click="updateTime">最后更新时间 <span :class="{'icon-Gm-sort-default': !orders, 'icon-Gm-sort-ascending': orders == 'ASC', 'icon-Gm-sort-descending': orders == 'DESC'}"><span class="path1"></span><span class="path2"></span></span></div>
            <div class="dy-fx-2">创建人</div>
          </div>
        </div>
        <div class="dy-flex color-666 house-two-tone" @mouseenter="addbgcolor(index)" @mouseleave="removebgcolor(index)" v-for="(item, index) in listData">
          <div class="dy-fx-1">{{index+1}}</div>
          <div class="dy-fx-3 ellipsis-1" :title="item.shareTitle">{{item.shareTitle}}</div>
          <div class="dy-fx-3 ellipsis-1" :title="item.projectName">{{item.projectName || '--'}}</div>
          <div class="dy-fx-3 ellipsis-1" :title="item.createTime">{{item.createTime | framtTime}}</div>
          <div class="dy-fx-3 ellipsis-1" :title="item.lastUpdateTime">{{item.lastUpdateTime | framtTime}}</div>
          <div class="dy-fx-2 ellipsis-1">{{item.creator}}</div>
        </div>
      </div>
    </div>
    <div class="house-right">
      <div class="house-title">操作</div>
      <div class="house-operate" v-for="(item, index) in listData">
        <a href="javascript:;" @click="sharingWxCode(item.url)">分享</a>
        <a target="_blank" :href="'#/houseEdit?id='+item.houseResourceRd+'&ddtab=true'" v-if="quanxian.indexOf('c171') > -1">编辑</a>

				<el-tooltip placement="right" effect="light" transition="linear">
					<div slot="content" style="padding: 0 10px;">
						<div class="pb-10"><a target="_blank" :href="'#/houseInfo?id='+item.houseResourceRd+'&ddtab=true'">详情</a></div>
						<div ><a target="_blank" :href="'#/hosuePreview?id='+item.houseResourceRd+'&ddtab=true'">预览</a></div>
						<div class="pt-10" v-if="quanxian.indexOf('c375') > -1"><a @click="delInfo(item)">删除</a></div>
					</div>
				  <a>更多</a>
				</el-tooltip>
      </div>
    </div>
  </div>

  <div class="user-page ptb-10 clearfix">
    <div class="pull-left user-page-num">
      <span class="font-14">共<i>{{totalCount}}</i>条记录</span>
      <span>每页<hl-select :data="pageCounts" v-model="limit" width="80" @on-change="selectPerNum"></hl-select>条</span>
    </div>
    <div class="pull-right">
      <hl-pagination v-model="currentPage" :total="totalPage" @change="getlistData"></hl-pagination>
    </div>
  </div>

  <div class="code-mark" v-if="erweimaflag">
    <div class="code-erweima br-4">
      <div class="icon-Gm-close cursor colse-erweima" @click="erweimaflag = !erweimaflag"></div>
      <div id="qrcode"></div>
      <p>（手机扫码即可即时预览，也可直接保存到本地）</p>
      <div class="button-footer">
        <div class="save-erweima cursor" @click="saveImageDown">保存</div>
        <div class="cancel-erweima cursor" @click="erweimaflag = !erweimaflag">取消</div>
      </div>
    </div>
  </div>
</section>

<script src="modules/rent/scripts/house_sharing.js" charset="utf-8"></script>

<style media="screen">
  /* //二维码 */
  .code-mark {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    display: flex;
    justify-content:center;
    align-items:center;
    z-index: 99999;
  }
  .code-erweima {
    width: 400px;
    position: relative;
    background: #fff;
    box-shadow:0px 0px 6px 0px rgba(136,136,136,0.75);
  }
  .colse-erweima {
    position: absolute;
    right:0;
    top: 0;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
  }
  #qrcode {
    width: 121px;
    height: 121px;
    margin: 30px auto 15px;
    background: #ddd;
  }
  .code-erweima p {
    color: #999;
    text-align: center;
    padding-bottom: 15px;
  }
  .button-footer {
    display: flex;
  }
  .button-footer>div {
    flex: 1;
    height: 45px;
    line-height: 45px;
    text-align: center;
    color: #666;
    background:rgba(249,249,249,1);
  }
  .button-footer .save-erweima {
    background:rgba(68,73,135,1);
    color: #fff;
  }

  h4 {
    margin: 0;
  }
  .color-cfcfcf {
    color: #cfcfcf;
    font-size:12px;
  }
  .search-container-house {
    position: relative;
  }
  .show-hide-term {
    width: 59px;
    height: 30px;
    line-height: 30px;
    color:rgba(244,174,71,1);
    margin-top: 5px;
    position: absolute;
    right: 0;
    bottom: 10px;
    background:rgba(244,174,71,0.3);
    border-radius:4px;
    text-align: right;
    padding-right: 5px;
  }
  .search-container-house .icon-turn-right {
    display: inline-block;
    transform: translate( -5px, 0) rotate(90deg);
  }
  .search-text {
    background:rgba(249,249,249,1);
    height: 34px;
    position:relative;
    width: 220px;
    border-radius: 4px;
  }
  .search-text span {
    position:absolute;
    left: 8px;
    top: 0;
    line-height: 34px;
  }
  .search-text input {
    width: 100%;
    height: 100%;
    background: none;
    border: 0;
    outline: medium;
    text-indent: 25px;
  }
  .calendar-text {
    background:rgba(249,249,249,1);
    width: 140px;
    height: 34px;
    border-radius: 4px;
  }
  .calendar-text .icon-Gm-calendar:before {
    top: 0;
    right: 0;
  }
  .calendar-text .hl-date-text {
    background: none;
    box-shadow: none;
    border: 0;
  }
  .house-sharing-text span {
    background:rgba(249,249,249,1);
    box-shadow: none;
    border: 0;
    color: #666;
  }
  input::-webkit-input-placeholder {
    color: #999;
  }
  input:-moz-placeholder {
    color: #999;
  }
  input:-ms-input-placeholder {
    color: #999;
  }
  .house-sharing-list {
    margin: 10px 0 0;
		display: flex;
    text-align: center;
    border-radius: 4px;
    border: 1px solid rgba(235,235,235,1);
  }
  .house-sharing-list .house-left {
    width: 813px;
    border-right: 1px solid rgba(235,235,235,1);
    line-height: 40px;
  }
  .house-sharing-list .house-right {
    width: 159px;
		min-width: 159px;
    line-height: 40px;
  }
  .house-title {
    background:rgba(240,242,255,1);
    color:rgba(165,170,183,1);
  }
  .house-operate {
    text-align: center;
    font-size: 0;
    height: 40px;
  }
  .house-operate a {
    font-size: 14px;
    margin: 0 3px;
  }
  .house-two-tone:nth-child(2n+1), .house-operate:nth-child(2n+1) {
    background:rgba(249,249,249,1);
  }
  .house-two-tone-hover {
    background:rgba(240,240,247,1) !important;
  }
</style>
